package com.demo;

import cn.hutool.core.util.RandomUtil;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;

import java.util.BitSet;
import java.util.concurrent.ThreadLocalRandom;

/**
 * @author shenguangyang
 */
public class BiMapDemo {
    public static void main(String[] args) {
        BiMap<String, String> biMap = HashBiMap.create();
        biMap.put("test1", "test1");
        biMap.put("test2", "test2");
        biMap.put("test3", "test3");
        biMap.remove("test1");
        System.out.println(biMap.get("test1"));
        System.out.println(biMap.size());
        BitSet bitSet = new BitSet();

//        for (int i = 0; i < 10000 * 1000; i++) {
//            String randomNumbers = RandomUtil.randomNumbers(6);
//            String result = biMap.get(randomNumbers);
//            if (result != null) {
//                System.out.println(result);
//                continue;
//            }
//            biMap.put(randomNumbers, i + "");
//        }
    }
}
